package com.hh.demo.mapper;

import com.hh.demo.entity.Clerk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 吉吉国王
 * @since 2022-12-05
 */
@Mapper
public interface ClerkMapper extends BaseMapper<Clerk> {
    //增加营业员
    @Insert("insert into `clerk` (`id`,`name`) values (#{id},#{name})")
    void insetClerk(String id, String name);
    //删除营业员
    @Delete("delete from clerk where id=#{id}")
    void deleteClerk(String id);
    //修改营业员信息
    @Update("update clerk set name='#{name}'")
    void updateClerk(String name);
    //查找营业员信息
    @Select("select * from clerk")
    List<Clerk> selectClerk();
    //根据id 查找 营业员
    @Select("select * from clerk where id=#{id}")
    List<Clerk> selectClerkById(String id);
}
